package workspace;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import views.TextListenerFactory;

public class Teszt {

	public static void main(String args[]) {
		Display display = new Display();
		Shell mainShell = new Shell(display);

		mainShell.setLayout(new GridLayout());

		Text text = new Text(mainShell, SWT.BORDER);
		text.addModifyListener(TextListenerFactory.szovegHosszListener(10));
		text.addKeyListener(TextListenerFactory.szovegesKeyListener());

		Text text2 = new Text(mainShell, SWT.BORDER);
		text2.addModifyListener(TextListenerFactory.szovegHosszListener(20));
		text2.addKeyListener(TextListenerFactory.userNameKeyListener());

		Text text3 = new Text(mainShell, SWT.BORDER);
		text3.addModifyListener(TextListenerFactory.szovegHosszListener(30));
		text3.addKeyListener(TextListenerFactory.passwordKeyListener());

		mainShell.open();
		mainShell.setText("AudiAkademie Teremnyilvantartas v0.1 rv42");

		while (!mainShell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		mainShell.dispose();
	}

}
